home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
cmln0885.arc
/
SMALTAL2.FIG
< prev
next >
Wrap
Text File
|
1986-02-27
|
2KB
|
31 lines
FIGURE 2:
Method for nextGap, sample Filter blocks, and a Spell window
+Class Hierarchy Browser---------++Workspace-----------------------------------+
| Prompter |next:put: ||FILTER BLOCKS FOR CLASS FILTER & WORDFILTER |
| Rectangle |nextChunk || |
| Speller |nextChunkPut: ||"Strip all control chars. Assume set CtrlCh"|
| Stream |nextGap || [:ch | (CtrlCh includes: ch) |è| ReadStream |nextLine || ifTrue: [''] |
| WriteStream |nextMatchFor: || ifFalse: [ch]] |
| ReadWriteStr|---------+------|| |
| FileStream |instance |class ||"Capitalize every word in a file" |
|---------------+---------+------|| [:word :gap | (word replaceFrom: 1 to: 1 |
|nextGap || with: (String with: (word at: 1) |
| "Return string containing the || asUpperCase)), gap] |
| next interword gap" || |
| |first| ||"Output list of unique words. Assume |
| first := self position max: 1.|| aSet := Set new. eol := String with: Cr" |
| [self atEnd || [:word :gap | (aSet includes: word) |
| or: [self peek isLetter]] || ifTrue: [''] |
| whileFalse: [self next]. || ifFalse: [aSet add: word. word , eol]] |
| ^self copyFrom: first || |
| to: self position ||"Mark all misspelled words in a file" |
+================================+| [:word :gap | (Webster spell: word) , gap] |
+Workspace---------+Suspect word--+ |
| |hee*_ |"Interactively spell check words in a file" |
|Spell check: 'hee'+==============+ [:word :gap | (Webster check: word) , gap] |
==================================+============================================+